# -*- coding: utf-8 -*-
"""
Version: 0.1
Author: CarpeDiem
Date: 2022/3/30
Description: 定制自己的手机套餐
"""
calling_plan = ["0分钟", "50分钟", "100分钟", "300分钟", "不限量"]
flow_plan = ["0M", "500M", "1G", "5G", "不限量"]
message_plan = ["0条", "50条", "100条"]
print("定制自己的手机套餐：")
#A.通话时长的选择
print("A.请设置通话时长：")
for index, calling in enumerate(calling_plan):
    print(str(index + 1) + "." + calling)
user_calling_plan = int(input("输入选择的通话时长编号："))
while user_calling_plan > len(calling_plan) or user_calling_plan <= 0:
    user_calling_plan = int(input("请输入正确的套餐编号："))
    if 0 < user_calling_plan <= len(calling_plan):
        break
numA = user_calling_plan
#B.流量的选择
print("B.请设置流量包：")
for index, flow in enumerate(flow_plan):
    print(str(index + 1) + "." + flow)
user_flow_plan = int(input("输入选择的流量包编号："))
while user_flow_plan > len(flow_plan) or user_flow_plan <= 0:
    user_flow_plan = int(input("请输入正确的套餐编号："))
    if 0 < user_flow_plan <= len(flow_plan):
        break
numB = user_flow_plan
#C.短信的选择
print("C.请设置短信条数：")
for index, message in enumerate(message_plan):
    print(str(index + 1) + "." + message)
user_message_plan = int(input("输入选择的短信条数编号："))
while user_message_plan > len(message_plan) or user_message_plan <= 0:
    user_message_plan = int(input("请输入正确的套餐编号："))
    if 0 < user_message_plan <= len(message_plan):
        break
numC = user_message_plan
#输出套餐结果
print("您的手机套餐定制成功：" + "免费通话时长为" + calling_plan[numA - 1] + "/月，" + "流量为" +
      flow_plan[numB - 1] + "/月，" + "短信条数" + message_plan[numC - 1] + "/月，")